<!-- 教学管理-课程安排-课程库 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="机构名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="导游名称">
              <el-input v-model="listQuery.fbillno" placeholder="请输入编号或名称" clearable />
            </el-form-item>
          </el-col>

          <template v-if="showAll">

            <el-col :span="6">
              <el-form-item label="人员状态">
                <el-select v-model="listQuery.fbillstate" placeholder="请选择">
                  <el-option v-for="item in statuslist" :key="item.id" :label="item.fullName" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </template>
          <el-col :span="8">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <!-- <el-button type="primary" icon="el-icon-plus" @click="insert(undefined)">新增</el-button> -->
              <el-button type="success" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FBILLNAME" label="机构名称"></el-table-column>
          <el-table-column prop="FBILLNO" label="导师编号" ></el-table-column>
          <el-table-column prop="FTEACH" label="导师姓名" ></el-table-column>
          <el-table-column prop="FTEL" label="电话号码" ></el-table-column>
          <el-table-column prop="FBILLSTATE" label="人员状态" width="85" ></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="100">
            <template slot-scope="scope">
              <el-button type="text" @click="insert(scope.row.FBILLNO)" size="small" icon="el-icon-edit">
                查看
              </el-button>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,
        statuslist: [
          {
            id: 1, fullName: '正常'
          },
          {
            id: 2, fullName: '暂停'
          },
          {
            id: 3, fullName: '注销'
          }
        ],

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '蓝湖营地教育冬令营'
        }, {
          value: 'L002',
          label: '上海研学教育中心'
        }, {
          value: 'L003',
          label: '上海科技研学基地'
        }, {
          value: 'L004',
          label: '上海文化之旅研学机构'
        }],


        customlist:[
          {
            "FTEL":"奉贤海湾校区",
            "FBILLNO": "010908075423.97",
            "FBILLNAME": "综合化学实验1",
            "FTEACH": "秦始皇",
            "FBILLTYPE": "走班课程",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": ""
          },
        ],
        list: [
           {
            "FTEL":"021-63358698",
            "FBILLNO": "010908075460",
            "FBILLNAME": "蓝湖营地教育冬令营",
            "FTEACH": "张骞",
            "FBILLTYPE": "导游",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": "提供魔都奇幻游学冬令营"
            },
            {
            "FTEL":"021-36528698",
            "FBILLNO": "010908075465",
            "FBILLNAME": "‌上海研学教育中心",
            "FTEACH": "徐霞客",
            "FBILLTYPE": "导游",
            "FBILLSTATE": "正常",
            "FPOINT":"5",
            "FMEMO": "拥有丰富的教育资源"
            },{
            "FTEL":"021-68688698",
            "FBILLNO": "034908075465",
            "FBILLNAME": "上海科技研学基地",
            "FTEACH": "郑和",
            "FBILLTYPE": "讲师",
            "FBILLSTATE": "正常",
            "FPOINT":"3",
            "FMEMO": "专注于科技创新领域"
            },
            ,{
            "FTEL":"021-52268698",
            "FBILLNO": "034998565460",
            "FBILLNAME": "上海文化之旅研学机构",
            "FTEACH": "苏武",
            "FBILLTYPE": "讲师",
            "FBILLSTATE": "正常",
            "FPOINT":"5",
            "FMEMO": "深耕文化领域"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>